
	function returnData() {
	addEmailAddrsInfo();
	parent.tb_remove();
	}
	
	function closeBox() {
	parent.tb_remove();
	}

	
function addEmailAddrsInfo(){

	var listsize = self.document.getElementById('listsize').value;
	var pkid_string = parent.document.getElementById('all_trage_user').value ;
	var selectedSize = parent.document.getElementById('userInfo').length;
	var numz = 0;
	
	for(var i=0;i<listsize;i++){
		if(self.document.getElementById('checkone'+i).checked){
		var oOption = parent.document.createElement("OPTION");
				oOption.setAttribute("value", self.document.getElementById('checkone'+i).value);
				oOption.appendChild(parent.document.createTextNode(self.document.getElementById('checkone'+i).value));
				for(var j=0; j<selectedSize; j++){
					if(parent.document.getElementById('userInfo').options[j] !=undefined) {
						if(parent.document.getElementById('userInfo').options[j].value == self.document.getElementById('checkone'+i).value) {
							parent.document.getElementById('userInfo').options[j]= null;
						}
				 }
			}
		++numz;	
		parent.document.getElementById('userInfo').appendChild(oOption);		
		pkid_string += self.document.getElementById('checkone'+i).value+'#';
		}
	}
		parent.document.getElementById('user_num').innerHTML = parent.document.getElementById('userInfo').length 
		self.document.getElementById('all_target_id').value = pkid_string;
		parent.document.getElementById('all_trage_user').value = pkid_string;
	
		alert("您已添加"+numz+"位用户！");
}

function removeEmailAddrsInfo(){

	var listsize = self.document.getElementById('listsize').value;
	var selectedSize = parent.document.getElementById('userInfo').length;
	var numz = 0;
	for(var i=0;i<listsize;i++){
		if(self.document.getElementById('checkone'+i).checked){
				for(var j=0; j<selectedSize; j++){
					if(parent.document.getElementById('userInfo').options[j] !=undefined) {
						if(parent.document.getElementById('userInfo').options[j].value == self.document.getElementById('checkone'+i).value) {
							parent.document.getElementById('userInfo').options[j]= null;
						}
					}
			}
					++numz;
		}

	}	
	parent.document.getElementById('user_num').innerHTML = "" + parent.document.getElementById('userInfo').length;	
	alert("您已添加"+numz+"位用户！");
}
	
	function addEmailAddrs(val) {
	var emailaddr = val.substr(1)
	emailaddrs += emailaddr.trim() + "|";
	}
	
	function removeEmailAddr(val){
	var emailaddr = val.substr(1)
	var regStr =emailaddr.trim()+"|";
	emailaddrs = emailaddrs.replace(regStr,"");
	}
	